#include <iostream>
#include <unistd.h>
#include <fcntl.h>
#include <cstdio>
#include <cstring>
using namespace std;
void SetNonBlock(int fd){
    int oldmod = fcntl(fd,F_GETFL);
    if(oldmod == -1){
        cerr<<"fcntl faild:"<<strerror(errno)<<endl;
    }
    fcntl(0,F_SETFL,oldmod | O_NONBLOCK);
}

